package cn.syncrond.tcm.intf;

import java.util.List;

import cn.syncrond.tcm.core.definition.ITask;
import cn.syncrond.tcm.core.pool.TaskPool;

/**
 * @Description: 任务池状态类
 * @author meepai
 * @date 2016-11-21
 */
public class TaskPoolStatus implements TaskPoolStatusMBean {

	public static final String NAME = TaskPoolStatus.class.getName() + ":name=status";
	
	/**
	 * 代理实际的任务池
	 */
	private TaskPool pool;
	
	public TaskPoolStatus(TaskPool pool){
		this.pool = pool;
	}
	
	@Override
	public List<ITask> getCurrentTasks() {
		return pool.getCurrentTasks();
	}

	@Override
	public List<ITask> getCompleteTasks() {
		return pool.getCompleteTasks();
	}

	@Override
	public List<ITask> getErrorTasks() {
		return pool.getErrorTasks();
	}

	@Override
	public List<ITask> getCancelTasks() {
		return pool.getCancelTasks();
	}
}
